src = $(wildcard *.c)	#.c文件

obj = $(patsubst %.c, %.o, $(src))	#.o文件

myArgs = -Wall -g
ALL:a.out

$(obj):%.o:%.c
	gcc -c $< -o $@ $(myArgs)

a.out: $(obj)
	gcc $^ -o $@ $(myArgs)

clean:
	-rm -rf $(obj) a.out

.PHONY: clean ALL
